$:.unshift File.join(File.dirname(__FILE__),'..','lib')

require 'rubygems'
require 'roadrunner'
require 'rfuzz/client'
require 'httparty'

rclient=RoadRunner.new
#client.mode = 'thread'

rclient.init do
  # users决定同时有多少并发用户一起执行action
  # iterations决定每个用户执行多少次
  @rc = RFuzz::HttpClient.new('10.2.226.132', 6080)
  rclient.users,rclient.iterations=10,100
end

rclient.action do
  @rc.get('/').http_body
  true
end

rclient.run
rclient.report
client.save_report(:name=>"clientHomeAndSports")

hclient=RoadRunner.new
hclient.users,hclient.iterations=10,100
hclient.action{resp = HTTParty.get('http://10.2.226.132:6080')}
hclient.run
hclient.report